#include <stdio.h>
#include "test_cJSON.h"
#include "thirdparty/cJSON/cJSON.h"

void test_cJSON()
{
    char* json_str = "{\"age\": 18, \"name\": \"zhangsan\"}";
    cJSON *json_obj = cJSON_Parse(json_str);

    cJSON *age = cJSON_GetObjectItem(json_obj, "age");
    cJSON *name = cJSON_GetObjectItem(json_obj, "name");

    printf("Name: %s, age: %d\n", name->valuestring, age->valueint);


    cJSON_Delete(json_obj);
}